package com.xuecheng.orders.feignClient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author xiao
 * @Date 2024/12/25 下午 3:24
 * @ClassName: ContentFeignFallBackFactory
 * @Description: TODO
 */
@Component
@Slf4j
public class ContentFeignFallBackFactory implements FallbackFactory<ContentFeign> {
    @Override
    public ContentFeign create(Throwable throwable) {
        return new ContentFeign() {
            @Override
            public Double getCoursePriceCount(Long[] ids) {
                log.error("远程调用课程价格查询发送了熔断，课程ids:{}",ids);
                return 0.0;
            }
        };
    }
}
